package blogger.client.async.services;

import blogger.client.model.entity.User;
import blogger.client.model.entity.UserDetails;

import com.google.gwt.user.client.rpc.ServiceDefTarget;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.google.gwt.core.client.GWT;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: mega
 * Date: 24.12.2009
 * Time: 9:43:16
 * To change this template use File | Settings | File Templates.
 */
@RemoteServiceRelativePath("UserService")
public interface UserService extends RemoteService {
    public long getCurrentUserId();

    public User getUserById(long id);

    public List<User> getUsers(List<Long> ids);

    public UserDetails getUserDetailsById(long id);



    public static class App {
        private static final UserServiceAsync ourInstance;

        static {
            ourInstance = (UserServiceAsync) GWT.create(UserService.class);
            ((ServiceDefTarget) ourInstance).setServiceEntryPoint(GWT.getModuleBaseURL() + "UserService");
        }

        public static UserServiceAsync getInstance() {
            return ourInstance;
        }
    }
}
